<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "{{%role}}".
 *
 * @property int $id
 * @property string $name 角色名
 * @property string $description 角色描述
 * @property string $jurisdiction 拥有的权限
 * @property string $create_user 创建人
 * @property int $create_time 创建时间
 */
class Role extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%role}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'description', 'jurisdiction', 'create_user', 'create_time'], 'required'],
            [['create_time'], 'integer'],
            [['name', 'create_user'], 'string', 'max' => 20],
            [['description'], 'string', 'max' => 100],
            [['jurisdiction'], 'string', 'max' => 1000],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '角色名',
            'description' => '角色描述',
            'jurisdiction' => '拥有的权限',
            'create_user' => '创建人',
            'create_time' => '创建时间',
        ];
    }
}
